<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<head>
<title>using commons fileupload to upload file</title>
</head>

<body>
<div align="center">
  <p>请选择上传的文件 </p>
  <form action="<%=request.getContextPath() %>/uploadServlet" method="post" enctype="multipart/form-data" name="form1" id="form1">
    <table width="428" border="0">
      <tr>
        <td width="130">上传人：</td>
        <td width="282"><label for="uploadername"></label>
        <input type="text" name="uploadername" id="uploadername" /></td>
      </tr>
      <tr>
        <td>上传文件：</td>
        <td><label for="uploadfile"></label>
        <input type="file" name="uploadfile" id="uploadfile" /></td>
      </tr>
      <tr>
        <td><input type="reset" name="reset" id="reset" value="重置" /></td>
        <td><input type="submit" name="submit" id="submit" value="提交" /></td>
      </tr>
    </table>
  </form>
  <p><a href="${ctx}">返回主页</a></p>
</div>

</body>
</html>
